#ifndef _HTTP_SERVER_H_
#define _HTTP_SERVER_H_
#ifdef _WIN32
#include <winsock2.h>
#include <stdio.h>
#pragma comment(lib,"ws2_32.lib")
#endif

#include "mongoose.h"
#include "json/json.h"
class HttpService {
public:
    bool start(const char* port);
private:
    static void mgEvHandler(struct mg_connection* nc, int ev, void* p);
    static void mgSendBody(struct mg_connection* nc, const char* content); //发送body信息
    static void mgSendFile(struct mg_connection* nc, struct http_message* hm, const char* filePath);
    void HttpRspJson(mg_connection* nc, Json::Value& rsq);
    static struct mg_serve_http_opts s_http_server_opts;
};

#endif // _HTTP_SERVER_H_